#ifndef _RADARPLOT_H
#define	_RADARPLOT_H

#include "ui_RadarPlot.h"
#include <vector>
#include <complex>
#include <boost/circular_buffer.hpp>
#include <QTimer>
#include <QMouseEvent>

class RadarPlot : public QWidget {
    Q_OBJECT
    
    public:
        RadarPlot();
        virtual ~RadarPlot();
        void paintEvent(QPaintEvent*);
        void setDAzimuth(double);
        void setDataBuffer(boost::circular_buffer<std::vector<std::complex<double> > >*);
        void mousePressEvent(QMouseEvent*);
        void resizeEvent(QResizeEvent*);
        std::complex<double> accumulate(std::vector<std::complex<double> >*, int, int);
        
    public slots:
        void tick();
            
    private:
        Ui::RadarPlot widget;
        QImage* cacheImage;
        QPainter* cachePainter;
        QTimer* timer;
        boost::circular_buffer<std::vector<std::complex<double> > >* dataBuffer;
        int step;
        double dAzimuth;
        
};

#endif	/* _RADARPLOT_H */
